package websocket;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import javax.jms.Session;
import javax.ws.rs.PathParam;

public class MyWebSocketServer {
//
//    private static Logger logger = LogManager.getLogger(WebsocketServer.class);
//
//    @OnOpen
//    public void onOpen(@PathParam("nodeId") String nodeId, @PathParam("nodeCode") int nodeCode, Session session){
//        logger.info("Start Connecting:"+ SessionUtils.getKey(nodeId, nodeCode));
//        SessionUtils.put(nodeId, nodeCode, session);
//    }
//
//    @OnMessage
//    public String onMessage(@PathParam("nodeId") String nodeId,@PathParam("nodeCode") int nodeCode,String message) {
//        if("hello".equals(message)){
//            logger.info("connect success:" + SessionUtils.getKey(nodeId, nodeCode));
//        }
//        logger.info(message);
//        return "Got([nodeId:"+ nodeId + "] [nodeCode:"+ nodeCode+"]"+message+")" ;
//    }
//
//    @OnError
//    public void onError(@PathParam("nodeId") String nodeId, @PathParam("nodeCode") int nodeCode, Throwable throwable,
//                        Session session) {
//        logger.info("Connection error:" + SessionUtils.getKey(nodeId, nodeCode));
//        SessionUtils.remove(nodeId, nodeCode);
//    }
//
//    @OnClose
//    public void onClose(@PathParam("nodeId") String nodeId, @PathParam("nodeCode") int nodeCode, Session session) {
//        logger.info("Close Connection:" + SessionUtils.getKey(nodeId, nodeCode));
//        SessionUtils.remove(nodeId, nodeCode);
//    }

}
